home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS15.ADF
/
AmigaBasicProgs
/
Money
< prev
next >
Wrap
Text File
|
1988-04-20
|
6KB
|
368 lines
REM MONEYBAGS by Becky F. Matthews
REM This is a freely-distributable PUBLIC DOMAIN program.
DEFINT a-z
DEFLNG k
DEFLNG score
DIM mon(90)
DIM tax(90)
DIM sc(500)
sx=0:cx=140:k=TIMER:score=0:c$="":level=1
SAY ""
RANDOMIZE TIMER
SCREEN 1, 320, 200, 2, 1
WINDOW 2,"",(0,0)-(311,185),20,1
WINDOW 1,"Government Invasion Part I",(0,0)-(311,185),20,1
PALETTE 0,0,0,0
PALETTE 1,1,1,1
PALETTE 2,1,1,.13
PALETTE 3,1,0,0
CLS
c$="put joystick, in port 2"
b$=" Put Joystick in Port 2."
GOSUB printsay
GOSUB gamescreen
GOSUB objects
main:
GOSUB moneystart
GOSUB starpage
GOSUB moneypage
GOSUB noise
GOSUB move
GOSUB taxstart
GOSUB starpage
GOSUB taxpage
GOSUB noise
GOSUB move
GOSUB bothstart
GOSUB starpage
GOSUB bothpage
GOSUB noise
GOSUB move
IF level = 4 THEN GOTO win
level = level + 1
b$=" Level "+STR$(level)
GOSUB printsay
LOCATE 13,31
PRINT "Level";level
GOTO main
gamescreen:
c=1
FOR x = 1 TO 29 STEP 2
LINE(70+x,20+x)-(220-x,160-x),c,b
c=c+1:IF c > 3 THEN c = 1
SOUND x*100,.1
NEXT
FOR t = 1 TO 30
x=INT(RND*90)+100
y=INT(RND*80)+50
PSET(x,y),1
NEXT
COLOR 2,3
LOCATE 10,30
PRINT "MONEYBAGS"
COLOR 2,0
LOCATE 13,31
PRINT "Level";level
SOUND 300,1
RETURN
objects:
WINDOW OUTPUT 2
DIM bags$(130)
RESTORE bagsdata
FOR n = 1 TO 130
READ a
bags$ = bags$ + CHR$(a)
NEXT
OBJECT.SHAPE 1,bags$
OBJECT.X 1,10
OBJECT.Y 1,10
OBJECT.ON 1
GET(10,10)-(40,30),mon
OBJECT.CLOSE 1
DIM taxman$(130)
RESTORE taxmandata
FOR n = 1 TO 130
READ a
taxman$ = taxman$ + CHR$(a)
NEXT
OBJECT.SHAPE 2,taxman$
OBJECT.X 2,10
OBJECT.Y 2,10
OBJECT.ON 2
GET(10,10)-(30,30),tax
OBJECT.CLOSE 2
WINDOW 1
DIM sight$(60)
RESTORE sightdata
FOR n = 1 TO 60
READ a
sight$ = sight$ + CHR$(a)
NEXT
OBJECT.SHAPE 3,sight$
OBJECT.X 3,140
OBJECT.Y 3,134
OBJECT.ON 3
RETURN
moneystart:
c$="grab all the bags of money that you can"
b$=" Grab Money."
GOSUB printsay
RETURN
taxstart:
c$="now you will try to uhvoid the tax collectors"
b$=" Avoid Tax Collectors."
GOSUB printsay
RETURN
bothstart:
c$="Now grab the money bags and uhvoid the tax collectors"
b$=" Grab Money Not Taxmen."
GOSUB printsay
RETURN
move:
FOR t = 1 TO 2
FOR x = 10 TO 260 STEP 90
FOR y = 105 TO 1 STEP -3
WINDOW OUTPUT 2
GET(x,y)-(90+x,y+80),sc
WINDOW OUTPUT 1
PUT(100,50),sc,PSET
SOUND y*5+300,.1
GOSUB joystick
NEXT
FOR y = 1 TO 41
GET(100,51)-(190,127),sc
PUT(100,54),sc,PSET
LINE(100,50)-(190,53),0,bf
SOUND y*5+300,.1
GOSUB joystick
NEXT
NEXT
NEXT
RETURN
starpage:
WINDOW OUTPUT 2
CLS
FOR star = 1 TO 100
x=INT(RND*311):y=INT(RND*185)
PSET(x,y),1
NEXT
RETURN
moneypage:
s=0
FOR n = 1 TO 3
FOR t = 1 TO 11
x=t*30+10
y=INT(RND*8)*20+10
PUT(x-30,y),mon,PSET
NEXT
NEXT
RETURN
taxpage:
s=level-1
FOR t = 1 TO 11
x=t*23+10
FOR n = 1 TO (0+level)
y=INT(RND*7)*25+10
PUT(x-23,y),tax,PSET
NEXT
NEXT
RETURN
bothpage:
s=level
FOR t = 1 TO 11
x=t*30+10
FOR n = 1 TO (3+level)
y=INT(RND*7)*25+10
b=INT(RND*100)
IF b > 40 THEN
PUT(x-30,y),tax,PSET
ELSE
PUT(x,y),mon,PSET
END IF
NEXT
NEXT
RETURN
printsay:
IF c$="" THEN c$=b$
r$=TRANSLATE$(c$)
SAY(r$)
FOR x=1 TO 39
LOCATE 2,x
SOUND x*50,.1
PRINT LEFT$(b$,40-x)
NEXT
c$=""
RETURN
noise:
FOR n=1 TO 5
FOR p=800 TO 200 STEP -50
SOUND p,.2
NEXT
NEXT
RETURN
joystick:
IF STICK(2)=1 THEN GOSUB right
IF STICK(2)=-1 THEN GOSUB left
IF STICK(2)=0 AND sx=1 THEN GOSUB right
IF STICK(2)=0 AND sx=2 THEN GOSUB left
p = POINT(cx+3,125)
IF TIMER>k+.5 THEN
IF p = 3 OR p = 2 THEN GOSUB score
END IF
RETURN
right:
p = POINT(cx+3,125)
IF TIMER>k+.5 THEN
IF p = 3 OR p = 2 THEN GOSUB score
END IF
cx=cx+4
IF cx>182 THEN cx=182
IF cx<103 THEN cx=103
OBJECT.X 3,cx
sx=1
RETURN
left:
p=POINT(cx+3,125)
IF TIMER>k+.5 THEN
IF p = 3 OR p = 2 THEN GOSUB score
END IF
cx=cx-4
IF cx<103 THEN cx=103
IF cx>182 THEN cx=182
OBJECT.X 3,cx
sx=2
RETURN
score:
CIRCLE(cx+3,125),4,1
LOCATE 22,12
IF p = 2 THEN score = score + 1:SOUND 900,1
IF p = 3 THEN score = score - 5:SOUND 500,1
PRINT "MONEY = $";score*100;
IF score < 0 AND s>0 THEN
RETURN jail
ELSEIF score <0 THEN
RETURN restart
END IF
k=TIMER
RETURN
restart:
c$="You lost all your money too soon. Try again"
b$=" Try Again."
IF s=0 THEN GOSUB printsay
sx=0:cx=140:k=TIMER:score=0:c$="":level=1
CLS
OBJECT.X 3,cx
GOSUB gamescreen
GOTO main
jail:
FOR t = 1 TO 2
FOR n = 400 TO 100 STEP - 25
SOUND n,1
NEXT
NEXT
c$="You are broke. out of money and you owe the tax collector"
b$=" You're broke."
GOSUB printsay
b$=" Naughty naughty naughty."
GOSUB printsay
c$="The tax collector gets your howse and your car and all your worldly goodies"
b$=" Goodbye, goodies."
GOSUB printsay
c$="Now you must go to jail"
b$=" Go To Jail!"
GOSUB printsay
FOR x = 10 TO 300 STEP 35
LINE(x,0)-(x+10,185),1,bf
NEXT
gameover:
LOCATE 2,10
PRINT "Press Y to Play Again"
a$=""
WHILE a$=""
a$= INKEY$
WEND
IF UCASE$(a$)="Y" THEN GOTO restart
END
win:
CLS
c=1
FOR x = 1 TO 80 STEP 2
LINE(x,x)-(311-x,185-x),c,b
c=c+1:IF c>3 THEN c=1
SOUND x*80,.5
NEXT
LOCATE 12,16
PRINT "You Win!!"
GOTO gameover
bagsdata:
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 2, 0, 0, 0, 24
DATA 0, 0, 0, 13, 0, 24, 0, 3
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 3, 7,192, 0, 1,252
DATA 64, 0, 0,120, 0, 0, 3,207
DATA 0, 0, 6, 1,128, 0, 14, 79
DATA 192, 0, 14, 1,192, 0, 15,201
DATA 192, 0, 6, 1,128, 0, 3,207
DATA 0, 0, 0,252, 0, 0, 0, 0
DATA 0, 0
taxmandata:
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 2, 0, 0, 0, 24
DATA 0, 0, 0, 13, 0, 24, 0, 3
DATA 0, 0, 0,252, 0, 0, 0,104
DATA 0, 0, 0, 48, 0, 0, 7,223
DATA 0, 0, 14,219,128, 0, 14,219
DATA 128, 0, 14,221,128, 0, 12,253
DATA 128, 0, 13,255,128, 0, 1,206
DATA 0, 0, 1,206, 0, 0, 1,206
DATA 0, 0, 7,207,128, 0, 0,204
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 7,223, 0, 0, 14,219
DATA 128, 0, 14,219,128, 0, 14,221
DATA 128, 0, 12,253,128, 0, 1,254
DATA 0, 0, 1,206, 0, 0, 1,206
DATA 0, 0, 1,206, 0, 0, 7,207
DATA 128,128
sightdata:
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 2, 0, 0, 0, 16
DATA 0, 0, 0, 7, 0, 25, 0, 3
DATA 0, 0, 2, 0, 5, 0, 8,128
DATA 5, 0, 2, 0, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0, 0, 0,255
DATA 0, 0, 0, 0